package com.nmsl.medicine.service.impl;

import java.util.List;

import com.nmsl.medicine.domain.StorageInDetailRecord;
import com.nmsl.medicine.mapper.StorageInDetailRecordMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nmsl.medicine.mapper.MedicineStorageInRecordMapper;
import com.nmsl.medicine.domain.MedicineStorageInRecord;
import com.nmsl.medicine.service.IMedicineStorageInRecordService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 药品入库记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-14
 */
@Service
public class MedicineStorageInRecordServiceImpl implements IMedicineStorageInRecordService 
{
    @Autowired
    private MedicineStorageInRecordMapper medicineStorageInRecordMapper;
    @Autowired
    private StorageInDetailRecordMapper storageInDetailRecordMapper;

    /**
     * 查询药品入库记录
     * 
     * @param storageInId 药品入库记录主键
     * @return 药品入库记录
     */
    @Override
    public MedicineStorageInRecord selectMedicineStorageInRecordByStorageInId(Long storageInId)
    {
        return medicineStorageInRecordMapper.selectMedicineStorageInRecordByStorageInId(storageInId);
    }

    /**
     * 查询药品入库记录列表
     * 
     * @param medicineStorageInRecord 药品入库记录
     * @return 药品入库记录
     */
    @Override
    public List<MedicineStorageInRecord> selectMedicineStorageInRecordList(MedicineStorageInRecord medicineStorageInRecord)
    {
        return medicineStorageInRecordMapper.selectMedicineStorageInRecordList(medicineStorageInRecord);
    }

    /**
     * 新增药品入库记录
     * 
     * @param medicineStorageInRecord 药品入库记录
     * @return 结果
     */
    @Override
    public int insertMedicineStorageInRecord(MedicineStorageInRecord medicineStorageInRecord)
    {
        return medicineStorageInRecordMapper.insertMedicineStorageInRecord(medicineStorageInRecord);
    }

    /**
     * 修改药品入库记录
     * 
     * @param medicineStorageInRecord 药品入库记录
     * @return 结果
     */
    @Override
    public int updateMedicineStorageInRecord(MedicineStorageInRecord medicineStorageInRecord)
    {
        return medicineStorageInRecordMapper.updateMedicineStorageInRecord(medicineStorageInRecord);
    }

    /**
     * 批量删除药品入库记录
     * 
     * @param storageInIds 需要删除的药品入库记录主键
     * @return 结果
     */
    @Override
    public int deleteMedicineStorageInRecordByStorageInIds(Long[] storageInIds)
    {
        return medicineStorageInRecordMapper.deleteMedicineStorageInRecordByStorageInIds(storageInIds);
    }

    /**
     * 删除药品入库记录信息
     * 
     * @param storageInId 药品入库记录主键
     * @return 结果
     */
    @Override
    public int deleteMedicineStorageInRecordByStorageInId(Long storageInId)
    {
        return medicineStorageInRecordMapper.deleteMedicineStorageInRecordByStorageInId(storageInId);
    }


    /**
     * 审核
     */
    @Override
    public int shenhe(MedicineStorageInRecord medicineStorageInRecord){

        System.out.println(medicineStorageInRecord);

        return medicineStorageInRecordMapper.insertMedicineStorageInRecord(medicineStorageInRecord);

    }

    /**
     * 添加
     */
    @Override
    public int tianjia(StorageInDetailRecord storageInDetailRecord){

        System.out.println(storageInDetailRecord);
        return storageInDetailRecordMapper.insertStorageInDetailRecord(storageInDetailRecord);

    }
}
